/*
 * @Author: liujinjun681 liujinjun681@qq.com
 * @Date: 2022-06-27 10:46:56
 * @LastEditors: liujinjun681 liujinjun681@qq.com
 * @LastEditTime: 2022-11-10 15:33:06
 * @FilePath: \hd_ims_web\src\api\board\board.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from '@/utils/request'
import request from '@/utils/request'
class boardService {
  /**
   * @description:   换模任务看板-更新模具
   * @return {*}
   */
  updateChangeTaskBoard(data) {
    return axios.post('/board/changeTaskBoard/update', data)
  }
  /**
   * @description:  换模任务看板
   * @return {*}
   */
  getChangeTaskBoard() {
    return axios.get(`/board/changeTaskBoard`).then((res) => {
      return res.data
    })
  }

  /**
   * @description: 仓库库存及出货排程看板 (海尔空调/冷柜/电热/TCL空调/其它客户)
   * @return {*}
   */
  getinventoryShipment(khdm) {
    return axios.get(`/board/inventoryShipment/${khdm}`).then((res) => {
      return res.data
    })
  }
  /**
   * @description: 注塑产能看板报表
   * @param {*} params
   * @return {*}
   */
  getInjectionCapacityStatusReport(params) {
    return axios.get(`/board/InjectionCapacityStatusReport`, { params })
  }
  /**
   * @description: 注塑产能看板
   * @param {*} params
   * @return {*}
   */
  getInjectionCapacityStatus(params) {
    return axios.get(`/board/injectionCapacityStatus`, { params })
  }

  /**
   * @description: 机台多进程看板
   * @param {*} params
   * @return {*}
   */
  getMachineCapacityStatus(params) {
    return axios.get(`/board/machineCapacityStatus`, { params })
  }

  /**
   * @description: 机台效率看板
   * @param {*} params
   * @return {*}
   */
  getMachineEfficiencyBoard() {
    return axios.get(`/board/machineEfficiencyBoard`)
  }
  /**
   * @description: 机台状态看板-获取基本视图
   * @param {*} params
   * @return {*}
   */
  getMachineBoardBaseInfo() {
    return axios.get(`/board/machineBoardBaseInfo`)
  }
  /**
   * @description:机台状态看板-右键-机台效率信息
   * @param {*} machineCode 机台编号
   * @return {*}
   */
  getMachineEfficiencyByCode(machineCode) {
    return axios.get(`/board/machineEfficiency/${machineCode}`)
  }
  /**
   * @description: 获取机台
   * @return {*}
   */
  getMachines() {
    return axios.get(`/project/jtm/jtmDict/0`)
  }
  /**
   * @description: 生产状态分布及效率分析
   * @return {*}
   */
  getProduceState(params) {
    return axios.get('/production/Report/produce_state', {
      params: params,
    })
  }
  /**
   * @description: 机台状态看板-右键-机台负荷信息
   * @return {*}
   */
  getMachineLoad(machineCode) {
    return axios.get(`/board/machineLoad/${machineCode}`)
  }
  /**
   * @description: 机台进程看板
   * @return {*}
   */
  getMachineProcessBoard(params) {
    return axios.get(`/board/machineProcessBoard`, { params })
  }
  /**
   * @description: 模具状况看板
   * @return {*}
   */
  getModelStateBoard(params) {
    return axios.get(`/board/modelStateBoard`, { params })
  }
  /**
   * @description: 品质看板
   * @return {*}
   */
  getQualityKanBan(params) {
    return axios.get(`/board/qualityKanBan`, { params }).then((res) => {
      return res.data
    })
  }
  /**
   * @description: 战情看板
   * @return {*}
   */
  getSituationView(jtmWorkShop = 'work_1') {
    return axios.get(`/board/SituationView`, { params: { jtmWorkShop } }).then((res) => {
      return res.data
    })
  }

  getSituationViewBl() {
    return axios.get(`/board/SituationViewBl`).then((res) => {
      return res.data
    })
  }
  /**
   * @description: oee分析数据查询
   * @param {*} params beginTime 开始时间 endTime 结束时间
   * @return {*}
   */
  getOeeView(params) {
    return axios.get(`/board/getOeeView`, { params }).then((res) => {
      return res.data
    })
  }
  /**
   * @description: 前五台入库率最低的机器(每一小时请求一次)
   * @param {*}
   * @return {*}
   */
  getTopFiveInStorage(params) {
    return axios.get(`/board/getTopFiveInStorage`, { params }).then((res) => {
      return res.data
    })
  }
  /**
   * @description: 喷涂车间看板计划获取
   * @return {*}
   */
  getSprayingView(params) {
    return axios.get(`/board/getSprayingView`, { params }).then((res) => {
      return res.data
    })
  }

  /**
   * @description: Colmo高端线数据获取
   * @return {*}
   */
  getColmoView(params) {
    return axios.get(`/board/getColmoView`, { params }).then((res) => {
      return res.data
    })
  }
  /**
   * @description: 最近7天的開機書
   * @return {*}
   */
  listMachineStartRate(params) {
    return axios.get(`/board/listMachineStartRate`, { params }).then((res) => {
      return res.data
    })
  }

  // 导出仓库数据
  exportData(params) {
    return request({
      url: '/board/export',
      method: 'get',
      params: params,
    })
  }
}
export default new boardService()
